-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show notification if payment requires fee acceptance #634
Show notification if payment requires fee acceptance #634
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
lib/bindings/langs/android/lib/src/main/kotlin/breez_sdk_liquid_notification/job/SwapUpdated.kt
Outdated
Show resolved
Hide resolved
lib/bindings/langs/swift/Sources/BreezSDKLiquid/Task/SwapUpdated.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Note that I added a comment probably not related to this PR.
is SdkEvent.PaymentSucceeded -> handlePaymentEvent(e.details) | ||
is SdkEvent.PaymentWaitingConfirmation -> handlePaymentSuccess(e.details) | ||
is SdkEvent.PaymentSucceeded -> handlePaymentSuccess(e.details) | ||
is SdkEvent.PaymentWaitingFeeAcceptance -> handlePaymentWaitingFeeAcceptance(e.details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment here is not related to this PR but I think we might miss the notification if the app keeps working in the background and we have two sdk instances as one instance will emit it and the notifications job instance will miss it?
Perhaps we should record the state when we get the notification and poll for changes in addition to waiting for events?
@dangeross what do you think?
Even if this is indeed something we need to fix I suggest not to handle that as part of this PR as it was introduced before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the swap is already WaitingFeeAcceptance I guess the swap isn't tracked (last swap status received in loop) when the notification SDK instance is started? If so I think you're right, we should fetch the payment by the hashed swap id, then check it's state and/or wait for events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9190972
to
86a099f
Compare
0c21c7e
to
74c5764
Compare
74c5764
to
e80e907
Compare
I've manually tested this on both iOS and Android, and it works as expected. |
If a payment is waiting fee acceptance, let's show a notification asking the user to review the payment.